package com.acme.bankapp.domain.bank;


public class Client {

	private Account account;
	private String name;
	Gender gender;
	private int Id;

	public Client(Account account, Gender gender, String name, int id) {
		this.account = account;
		this.gender = gender;
		this.name = name;
		this.Id = id;
	}

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}

	public Account getAccount() {
		return account;
	}
	
	@Override
	public int hashCode() {
		return Id;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) return true;
		if (obj == null) return false;
		if (getClass() != obj.getClass())return false;
		Client other = (Client) obj;
		if (Id != other.Id)	return false;
		return true;
	}

	@Override
	public String toString() {
		StringBuffer stb = new StringBuffer();
		stb.append(gender + " ");
		stb.append(this.name + " ");
		stb.append("your balance = " + this.account.decimalValue() + "\n");
		return stb.toString();
	}
}
